﻿@model PersonalAccount_AlterEmailAddress
@{
    ViewData["Title"] = "Index";
    Layout = "~/Views/Shared/_OridinaryPage.cshtml";
}

@section Header{
    <link rel="stylesheet" href="~/css/common.css" />
    <link rel="stylesheet" href="~/js/plugins/autoComplete/jquery.autocomplete.css" />
    <link rel="stylesheet" href="~/js/plugins/bootstrap-table/bootstrap-table.css" />
}

<section>
    <!--<h2>
        <small></small>
    </h2>-->
    <ol class="breadcrumb breadcrumb-pd clear-mgb bg-transparent">
        <li><a href="#"><i class="fa fa-dashboard"></i>个人域账号管理</a></li>
        <li class="active">邮件地址变更</li>
    </ol>
</section>
<!-- Main content -->
<section class="content-mini clear-pdt clear-pdb">
    <div class="row">
        <div class="col-xs-12">
            <div class="box">
                <!--<div class="box-header">
                    <h3 class="box-title"></h3>
                </div>-->
                <!-- /.box-header -->
                <div class="box-body">
                    <form class="form-horizontal" id="dataForm">
                        <input type="hidden" id="Id" name="Id" value="@Model.Id" />
                        <input type="hidden" id="TaskId" name="TaskId" value="@ViewBag.TaskId" />
                        <input type="hidden" id="Action" name="Action" value="" />
                        <div class="form-group">
                            <div class="container-fluid">
                                <div class="row">
                                    <div class="col-xs-12">
                                        <div class="row">
                                            <div class="col-xs-3">
                                                <label for="SAMAccountName" class="col-xs-2 control-label  text-left pd-lft pd-rt">域账号</label>
                                                <div class="col-xs-10">
                                                    <input type="text" class="form-control userAC" id="SAMAccountName" name="SAMAccountName" placeholder="域账号" value="@Model.SAMAccountName">
                                                </div>
                                            </div>
                                            <div class="col-xs-3">
                                                <label for="OldEmailName" class="col-xs-2 control-label  text-left pd-lft pd-rt">原Email</label>
                                                <div class="col-xs-10">
                                                    <input type="text" class="form-control" id="OldEmailName" name="OldEmailName" placeholder="原Email" value="@Model.OldEmailName">
                                                </div>
                                            </div>
                                            <div class="col-xs-3">
                                                <label for="NewEmailName" class="col-xs-2 control-label  text-left pd-lft pd-rt">新Email</label>
                                                <div class="col-xs-10 input-group" style="padding-right:15px;padding-left:15px;">
                                                    <input type="text" class="form-control" id="NewEmailName" name="NewEmailName" placeholder="新Email" value="@Model.NewEmailName">
                                                    <span class="input-group-addon">@(Dapper_Core.Model.AppVariable.H3cEmailPostfix)</span>
                                                </div>
                                            </div>
                                            <div class="col-xs-3">
                                                <label for="FirstDeptCode" class="col-xs-2 control-label  text-left pd-lft pd-rt">一级部门</label>
                                                <div class="col-xs-10">
                                                    <input type="text" class="form-control" id="FirstDeptCode" name="FirstDeptCode" placeholder="一级部门" value="@ViewBag.Dept1Name">
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="form-group">
                            <div class="container-fluid">
                                <div class="row">
                                    <div class="col-xs-12">
                                        <div class="row">
                                            <div class="col-xs-3">
                                                <label for="SecondDeptCode" class="col-xs-2 control-label  text-left pd-lft pd-rt">二级部门</label>
                                                <div class="col-xs-10">
                                                    <input type="text" class="form-control" id="SecondDeptCode" name="SecondDeptCode" placeholder="二级部门" value="@ViewBag.Dept2Name">
                                                </div>
                                            </div>
                                            <div class="col-xs-3">
                                                <label for="ThirdDeptCode" class="col-xs-2 control-label  text-left pd-lft pd-rt">三级部门</label>
                                                <div class="col-xs-10">
                                                    <input type="text" class="form-control" id="ThirdDeptCode" name="ThirdDeptCode" placeholder="三级部门" value="@ViewBag.Dept3Name">
                                                </div>
                                            </div>
                                            <div class="col-xs-3">
                                                <label for="DeptManager" class="col-xs-2 control-label  text-left pd-lft pd-rt">部门经理</label>
                                                <div class="col-xs-10">
                                                    <input type="text" class="form-control" id="DeptManager" name="DeptManager" placeholder="部门经理" value="@Model.DeptManager">
                                                </div>
                                            </div>
                                            <div class="col-xs-3">
                                                <label for="SimpleDisplayName" class="col-xs-2 control-label  text-left pd-lft pd-rt">对外显示名</label>
                                                <div class="col-xs-10">
                                                    <input type="text" class="form-control" id="SimpleDisplayName" name="SimpleDisplayName" placeholder="对外显示名" value="@Model.SimpleDisplayName">
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="form-group">
                            <div class="container-fluid">
                                <div class="row">
                                    <div class="col-xs-12">
                                        <div class="row">
                                            <div class="col-xs-3">
                                                <label for="ProxyMan" class="col-xs-2 control-label  text-left pd-lft pd-rt">代申请人</label>
                                                <div class="col-xs-10">
                                                    <input type="text" class="form-control" id="ProxyMan" name="ProxyMan" placeholder="代申请人" value="@(Model.ProxyMan)">
                                                </div>
                                            </div>
                                            <div class="col-xs-3">
                                                <label for="CreateDate" class="col-xs-2 control-label  text-left pd-lft pd-rt">申请时间</label>
                                                <div class="col-xs-10">
                                                    <input type="text" class="form-control" id="CreateDate" name="CreateDate" placeholder="申请时间" value="@(Model.CreateDate)">
                                                </div>
                                            </div>
                                            <div class="col-xs-3">
                                                <label for="Remarks" class="col-xs-2 control-label  text-left pd-lft pd-rt">原因</label>
                                                <div class="col-xs-10">
                                                    <input type="text" class="form-control" maxlength="200" placeholder="原因" value="@Model.Remarks">
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                        @if (ViewBag.IsCheckman)
                        {

                            <div class="form-group">
                                <div class="container-fluid">
                                    <div class="row">
                                        <div class="col-xs-12">
                                            <div class="row">
                                                <div class="col-xs-6">
                                                    <label for="Remarks" class="col-xs-1 control-label text-left pd-lft pd-rt">审批意见</label>
                                                    <div class="col-xs-11">
                                                        <input type="text" class="form-control" id="Remarks" name="Remarks" placeholder="审批意见" value="" maxlength="50">
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        }
                    </form>
                    <div class="form-group" style="text-align:center;margin-top:10px;">
                        @foreach (WorkflowTransition item in ViewBag.ActionList)
                        {
                            <button type="button" class="btn btn-blue boxShadowNone btnWidth120 submit" value="@item.Code">@item.Name</button>
                        }
                    </div>
                </div>
                <!-- /.box-body -->
            </div>
            <!-- /.box -->
        </div>
        <!-- /.col -->
    </div>
    <!-- /.row -->
    <div class="row">
        <div class="col-xs-12">
            <div class="box  box-success clear-mgb clearBoxTopBorder clearShadow">
                @*<div class="box-header">
                        <h3 class="box-title">审批记录</h3>
                    </div>*@
                <!-- /.box-header -->
                <div class="box-body clear-pd">
                    <table id="dataWorkflowNode" class="table table-bordered table-hover"></table>
                </div>
            </div>
        </div>
    </div>
</section>
<!-- /.content -->

@section Scripts{
    <script src="~/js/plugins/bootstrap-table/bootstrap-table.min.js"></script>
    <script src="~/js/plugins/bootstrap-table/locale/bootstrap-table-zh-CN.js"></script>
    <script src="~/js/layer-extend.js"></script>
    <script type="text/javascript">
        $(document).ready(function () {
            //1.初始化审批记录Table
            var workflowTypeId = $("#Id").val();
            var oTable = new WorkflowNodeTableInit('/Workflow/WorkflowRecord/GetWorkflowRecordByWorkflowTypeId', workflowTypeId);
            oTable.Init();

            $("#dataForm input[type='text']:not(#Remarks)").attr("readonly", "readonly");
        });

        $(".submit").click(function () {
            var remarks = $("#Remarks").val();
            if (IsNullOrEmpty(remarks)) {
                alert("请输入审批意见！");
                $("#Remarks").focus();
                return;
            }
            IndexBtnDisabled();
            $("#Action").val($(this).val());
            $.ajax({
                type: "post",
                url: "/PersonalAccount/PersonalAccount_AlterEmailAddress/Audit",
                data: $("#dataForm").serialize(),
                dataType: "json",
                success: function (data) {
                    if (data.Success) {
                        closeAndRefreshUnderCheckingList();
                        alert(data.Message);
                    } else {
                        alert(data.Message);
                    }
                    IndexBtnEnabled();
                },
                error: function (err) { }
            });
        });
    </script>
}